﻿using System;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using FacialClub.Models;

namespace FacialClub.Models.Entities
{
    /// <summary>
    /// Email Template
    /// </summary>
    [Bind(Include = "EmailTemplateName,EmailTemplateDescription,IsVisible,CreatedOn")]
    [MetadataType(typeof(EmailTemplateMetaData))]
    public partial class EmailTemplate
    {
        /// <summary>
        /// Email Template Meta Data for Validation
        /// </summary>
        [Bind(Exclude = "EmailTemplateId")]
        public class EmailTemplateMetaData
        {
            /// <summary>
            /// EmailTemplateId
            /// </summary>
            [ScaffoldColumn(false)]
            public object EmailTemplateId { get; set; }

            /// <summary>
            /// Email Template Name
            /// </summary>
            [Required(ErrorMessage = "Email Template Name is required")]
            [StringLength(160)]
            public string EmailTemplateName { get; set; }

            /// <summary>
            /// Email Template Subject
            /// </summary>
            [Required(ErrorMessage = "Email Template Subject is required")]
            [StringLength(160)]
            public string EmailTemplateSubject { get; set; }

            /// <summary>
            /// Email Template Description
            /// </summary>
            [Required(ErrorMessage = "Email Template Description is required")]
            [DisplayName("Email Template Description")]
            [UIHint("Wysiwyg")]
            public string EmailTemplateDescription { get; set; }

            /// <summary>
            /// Visibility of the Template
            /// </summary>
            [DisplayName("Is Visible")]
            public bool IsVisible { get; set; }

            /// <summary>
            /// Template Creation Date
            /// </summary>
            [Required(ErrorMessage = "Date Not Selected")]
            //[RegularExpression(@"^([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0]?[1-9]|[1][0-2])[./-]([0-9]{4}|[0-9]{2})$", ErrorMessage = "The date is invalid.")]
            public DateTime CreatedOn { get; set; }
        }
    }
}